$(document).ready(function(){
	
	if($("#publishform")){
		$("#publishform").validate({
			rules: {
				title:{
					required : true,
					maxlength : 100
				},
				infoid: {
					required: true,
					digits:true
				},
				requirement: {
					required: true,
					maxlength:500
				},
				cname: {
					required: true
				},
				mobile: {
					required: true
				}
			},
			messages: {
				title:{
					required: "请输入标题",
					maxlength:"仅限100个字"
				},
				infoid: {
					required: "请输入信息编号",
					digits:"信息编号仅限数字"
				},
				requirement: {
					required: "请输入求租要求",
					maxlength:"仅限500个字"
				},
				cname: {
					required: "请输入联系人姓名"
				},
				mobile: {
					required: "请输入联系方式"
				}
			},
			submitHandler: function(form) {  
				$("#buttondiv").css("display" , "none");
				$("#fbmsg").css("display" , "");
				form.submit();  
			}
		});

		$("#submitbtn2").bind("click" , function(){
			$("#ispublic").val(1);
			$("#publishform").trigger("submit");
		});
	}
	
	
});